.netCHARTING v4.4 Documentation Send comments on this topic.
Map Interactivity
Getting Started > General Tutorials > Mapping > Map Interactivity

Glossary Item Box

The mapping functionality offers some unique features to enable interactivity.

Shape Hotspots

Shapes have a Hotspot property which allows mouseover tooltips and other interactive functionality. For more information see hotspots tutorial.

The most useful application of this is to set DefaultShape's hotspot properties as shown in this sample.

Sample: MapHotspots.aspx

Click to GPS (Lat/Long) coordinates

This feature allows a pixel coordinate on the map to be translated into GPS coordinates of the point based on the map. By capturing a user's click coordinate this information can be translated into GPS coordinates to provide zooming on the map or using the GPS position to query information from other services.

 

[C#]

Chart.FileManager.SaveImage();
PointF gpsPoint = Chart.Mapping.GetLatLongCoordinates("50,100");
[Visual Basic]

Chart.FileManager.SaveImage()
Dim gpsPoint AS Chart.Mapping.GetLatLongCoordinates("50,100")

This feature also works with projections applied to the map.

Samples:
ClickMap.aspx
ClickMapProjected.aspx
ClickMapZoom.aspx


 

Click to Shapes array

From the click pixel position an array of Shape objects that land under the coordinate can be acquired. This can be used to select specific shapes and display its details or modify any of its properties.

[C#]
Chart.FileManager.SaveImage();
ArrayList shapes = Chart.Mapping.GetShapesAtPoint("50,100);
[Visual Basic]
Chart.FileManager.SaveImage()
Dim shapes AS Chart.Mapping.GetShapesAtPoint("50,100)
Sample:
IdentifyShape.aspx
Note: The reason the SaveImage method is called is because the chart must be generated to have the information necessary to process these requests.